package com.ktg.web.wms;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.ktgcommon.aop.SecuredOperation;
import com.ktg.ktgcommon.domain.wms.WmArrivalNotice;
import com.ktg.ktgcommon.result.R;
import com.ktg.service.WmArrivalService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/WmArr")
public class WmArrivalController {
    @Resource
    private WmArrivalService wmArrivalService;
    @RequestMapping("/getPageList")
    @SecuredOperation("wm:arr:list")
    public R getPageList(@RequestParam(defaultValue = "1") Integer pageNo,
                         @RequestParam(defaultValue = "10") Integer pageSize,@RequestBody WmArrivalNotice wmArrivalNotice){
        Page<WmArrivalNotice> wmItemRecptPage = new Page<>(pageNo, pageSize);
        Page<WmArrivalNotice> wmItemRecptPage1 = wmArrivalService.getByWasStoPage(wmItemRecptPage,wmArrivalNotice);
        if (wmItemRecptPage1 != null) {
            return R.OK(wmItemRecptPage1);
        }
        return R.FAIL();
    }
}
